package com.common.retrofit.methods;

import com.common.retrofit.base.BaseMethods;
import com.common.retrofit.entity.bean.HomeBean;
import com.common.retrofit.service.HaiNingService;

import rx.Observable;
import rx.Subscriber;

public class HomeMethods extends BaseMethods {

    private static HomeMethods m_ins = null;

    public static HomeMethods getInstance() {
        if (m_ins == null) {
            synchronized (HomeMethods.class) {
                if (m_ins == null) {
                    m_ins = new HomeMethods();
                }
            }
        }
        return m_ins;
    }

    @Override
    protected String getHttpUrl() {
        return "Home/";
    }

    private HaiNingService initService() {
        return getRetrofit().create(HaiNingService.class);
    }


    public void index(Subscriber<HomeBean> subscriber,
                      int uid ,int page  ) {
        Observable observable = initService().index(System.currentTimeMillis()+"",
                "cfe028e7129e66a70d9ec3b7ba2d072e",uid ,page
        );
        toSubscribe(observable, subscriber);
    }
}
